﻿namespace MySqlSync.Core.Interfaces
{
    /// <summary>
    /// Redis服务接口
    /// </summary>
    public interface IRedisService : IDisposable
    {
        /// <summary>
        /// 获取最后同步时间
        /// </summary>
        Task<DateTime> GetLastSyncTimeAsync(string tableName);

        /// <summary>
        /// 设置最后同步时间
        /// </summary>
        Task SetLastSyncTimeAsync(string tableName, DateTime time);

        /// <summary>
        /// 获取最后同步的ID
        /// </summary>
        Task<long> GetLastSyncIdAsync(string tableName);

        /// <summary>
        /// 设置最后同步的ID
        /// </summary>
        Task SetLastSyncIdAsync(string tableName, long id);

        /// <summary>
        /// 检查是否已完成全量同步
        /// </summary>
        Task<bool> IsFullSyncCompletedAsync(string tableName);

        /// <summary>
        /// 设置全量同步完成状态
        /// </summary>
        Task SetFullSyncCompletedAsync(string tableName, bool completed);
    }
}
